[LINUX] Remove hypercall permission checks from privcmd driver.
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Thu, 24 Aug 2006 16:58:28 +0000 (17:58 +0100)
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Thu, 24 Aug 2006 16:58:28 +0000 (17:58 +0100)
This will allow the tools management to be revised independently
of dom0 kernel interfaces. Currently tools cannot be 'smarter'
than the kernel in terms of hypercalls they know about, because
the kernel disallows access to any hypercalls it does not know
about.

Signed-off-by: Keir Fraser <keir@xensource.com>
linux-2.6-xen-sparse/drivers/xen/privcmd/privcmd.c

index 390cf5c2013a6806319362b0c01c99f992e41b29..a1c4b6f68e5e5bf5a158052186627a1f2c6123d0 100644 (file)
@@ -35,9 +35,6 @@
 static struct proc_dir_entry *privcmd_intf;
 static struct proc_dir_entry *capabilities_intf;
 
-#define NR_HYPERCALLS 64
-static DECLARE_BITMAP(hypercall_permission_map, NR_HYPERCALLS);
-
 static int privcmd_ioctl(struct inode *inode, struct file *file,
                         unsigned int cmd, unsigned long data)
 {
@@ -51,12 +48,6 @@ static int privcmd_ioctl(struct inode *inode, struct file *file,
                if (copy_from_user(&hypercall, udata, sizeof(hypercall)))
                        return -EFAULT;
 
-               /* Check hypercall number for validity. */
-               if (hypercall.op >= NR_HYPERCALLS)
-                       return -EINVAL;
-               if (!test_bit(hypercall.op, hypercall_permission_map))
-                       return -EINVAL;
-
 #if defined(__i386__)
                __asm__ __volatile__ (
                        "pushl %%ebx; pushl %%ecx; pushl %%edx; "
@@ -262,20 +253,6 @@ static int __init privcmd_init(void)
        if (!is_running_on_xen())
                return -ENODEV;
 
-       /* Set of hypercalls that privileged applications may execute. */
-       set_bit(__HYPERVISOR_acm_op,           hypercall_permission_map);
-       set_bit(__HYPERVISOR_dom0_op,          hypercall_permission_map);
-       set_bit(__HYPERVISOR_event_channel_op, hypercall_permission_map);
-       set_bit(__HYPERVISOR_memory_op,        hypercall_permission_map);
-       set_bit(__HYPERVISOR_mmu_update,       hypercall_permission_map);
-       set_bit(__HYPERVISOR_mmuext_op,        hypercall_permission_map);
-       set_bit(__HYPERVISOR_xen_version,      hypercall_permission_map);
-       set_bit(__HYPERVISOR_sched_op,         hypercall_permission_map);
-       set_bit(__HYPERVISOR_sched_op_compat,  hypercall_permission_map);
-       set_bit(__HYPERVISOR_event_channel_op_compat,
-               hypercall_permission_map);
-       set_bit(__HYPERVISOR_hvm_op,           hypercall_permission_map);
-
        privcmd_intf = create_xen_proc_entry("privcmd", 0400);
        if (privcmd_intf != NULL)
                privcmd_intf->proc_fops = &privcmd_file_ops;